<?xml version="1.0" ?>
<schema
   targetNamespace="http://www.someserver.com/myns"
   xmlns:myns="http://www.someserver.com/myns"
   xmlns:gml="http://www.opengis.net/gml/3.2"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns="http://www.w3.org/2001/XMLSchema"
   elementFormDefault="qualified"
   version="1.0">

   <import namespace="http://www.opengis.net/gml/3.2"
           schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>

   <element name="Person" type="myns:PersonType"
            substitutionGroup="gml:AbstractFeature"/>
   <complexType name="PersonType">
      <complexContent>
         <extension base="gml:AbstractFeatureType">
            <sequence>
               <element name="lastName" nillable="true">
                  <simpleType>
                     <restriction base="string">
                        <maxLength value="30"/>
                     </restriction>
                  </simpleType>
               </element>
               <element name="firstName" nillable="true">
                  <simpleType>
                     <restriction base="string">
                        <maxLength value="10"/>
                     </restriction>
                  </simpleType>
               </element>
               <element name="age" type="integer" nillable="true"/>
               <element name="sex" type="string"/>
               <element name="spouse"
                        type="myns:PersonPropertyType" minOccurs="0"/>
               <element name="location" 
                        type="gml:PointPropertyType"
                        nillable="true"/>
               <element name="mailAddress" 
                        type="myns:AddressPropertyType" nillable="true"/>
               <element name="phone" type="xsd:string"
                        minOccurs="0" maxOccurs="unbounded"/>
               <element name="livesIn" type="myns:HousePropertyType"
                        minOccurs="0"/>
               <element name="isDriving" type="myns:CarPropertyType"
                        minOccurs="0"/>
            </sequence>
         </extension>
      </complexContent>
   </complexType>
   <complexType name="PersonPropertyType">
      <sequence>
         <element ref="myns:Person"  minOccurs="0"/>
      </sequence>
      <attributeGroup ref="gml:AssociationAttributeGroup"/>
   </complexType>
   <complexType name="AddressPropertyType">
      <sequence>
         <element name="Address" 
                  type="myns:AddressType" minOccurs="0" />
      </sequence>
      <attributeGroup ref="gml:AssociationAttributeGroup"/>
   </complexType>
   <complexType name="AddressType">
      <sequence>
         <element name="streetName" nillable="true">
            <simpleType>
               <restriction base="string">
                  <maxLength value="30"/>
               </restriction>
            </simpleType>
         </element>
         <element name="streetNumber" nillable="true">
            <simpleType>
               <restriction base="string">
                  <maxLength value="10"/>
               </restriction>
            </simpleType>
         </element>
         <element name="city" nillable="true">
            <simpleType>
               <restriction base="string">
                  <maxLength value="30"/>
               </restriction>
            </simpleType>
         </element>
         <element name="province" nillable="true">
            <simpleType>
               <restriction base="string">
                  <maxLength value="30"/>
               </restriction>
            </simpleType>
         </element>
         <element name="postalCode" nillable="true">
            <simpleType>
               <restriction base="string">
                  <maxLength value="15"/>
               </restriction>
            </simpleType>
         </element>
         <element name="country" nillable="true">
            <simpleType>
               <restriction base="string">
                  <maxLength value="30"/>
               </restriction>
            </simpleType>
         </element>
      </sequence>
      <attribute ref="gml:id" use="required"/>
   </complexType>

   <element name="Car" type="myns:CarType"
            substitutionGroup="gml:AbstractFeature"/>
   <complexType name="CarType">
      <complexContent>
         <extension base="gml:AbstractFeatureType">
            <sequence>
               <element name="model" type="xsd:string"/>
               <element name="age" type="xsd:nonNegativeInteger"/>
               <element name="colour">
                  <simpleType>
                     <restriction base="string">
                        <enumeration value="red"/>
                        <enumeration value="green"/>
                        <enumeration value="blue"/>
                        <enumeration value="yellow"/>
                        <enumeration value="black"/>
                        <enumeration value="white"/>
                     </restriction>
                  </simpleType>
               </element>
               <element name="location" type="gml:PointPropertyType"/>
            </sequence>
         </extension>
      </complexContent>
   </complexType>
   <complexType name="CarPropertyType">
      <sequence>
         <element ref="myns:Car"  minOccurs="0"/>
      </sequence>
      <attributeGroup ref="gml:AssociationAttributeGroup"/>
   </complexType>

   <element name="House" type="myns:HouseType"
            substitutionGroup="gml:AbstractFeature"/>
   <complexType name="HouseType">
      <complexContent>
         <extension base="gml:AbstractFeatureType">
            <sequence>
               <element name="numFloors" type="xsd:nonNegativeInteger"/>
               <element name="area" type="gml:MeasureType"/>
               <element name="location" type="gml:PointPropertyType"/>
               <element name="frontsOn" type="gml:CurvePropertyType"/>
               <element name="address" type="myns:AddressPropertyType"/>
            </sequence>
         </extension>
      </complexContent>
   </complexType>
   <complexType name="HousePropertyType">
      <sequence>
         <element ref="myns:House"  minOccurs="0"/>
      </sequence>
      <attributeGroup ref="gml:AssociationAttributeGroup"/>
   </complexType>
</schema>
